package main

import "fmt"

// Animal 动物
type Animal struct {
	Name string
}

func (a Animal) run() {
	fmt.Printf("%v在跑步\n", a.Name)
}

// Fish 鱼
type Fish struct {
	Age int
	Animal
}

func (f Fish) swin() {
	fmt.Printf("%v在游泳\n", f.Name)
}

func main() {
	var f = Fish{
		Age: 20,
		Animal: Animal{
			Name: "小红",
		},
	}
	f.run()
	f.swin()
}
